<!DOCTYPE html>
<html class="signin no-js" lang="${lang!}">
<head>
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="renderer" content="webkit">
<meta charset="utf-8">
<meta name="viewport"
	content="width=device-width, user-scalable=no, initial-scale=1, maximum-scale=1">
<meta name="description" content="${AppName!}">
<title>${AppName!}</title>
<!--  <link rel="stylesheet" href="${base!}/assets/bootstrap/css/bootstrap.min.css">
    <link rel="stylesheet" href="${base!}/assets/css/themify-icons.css">
    <link rel="stylesheet" href="${base!}/assets/css/animate.min.css">
    <link rel="stylesheet" href="${base!}/assets/css/skins/palette.css">
    <link rel="stylesheet" href="${base!}/assets/css/fonts/font.css">
    <link rel="stylesheet" href="${base!}/assets/css/main.css"> -->

<link rel="stylesheet"
	href="${base!}/bootstrap-v3.3.7/css/bootstrap.min.css">
<link rel="stylesheet"
	href="${base!}/plugins/Font-Awesome4.6.3/css/font-awesome.min.css">
<link rel="stylesheet"
	href="${base!}/plugins/ionicons-2.0.1/css/ionicons.min.css">
<link rel="stylesheet"
	href="${base!}/assets/desktop/css/AdminLTE.min.css">
<link rel="stylesheet" href="${base!}/plugins/iCheck/square/blue.css">

<style type="text/css">
.login-page, .register-page {
	background: url(${base!}/assets/img/login-bg.jpg) no-repeat top center
		fixed;
	background-size: cover;
	min-height: 100%;
	overflow-x: hidden !important;
	overflow-y: hidden !important;
}
.login-box-body, .register-box-body {
    background: rgba(255,255,255,0.8);
    padding: 60px 40px;
    border-top: 0;
    color: #666;
    -moz-border-radius: 6px;
    -webkit-border-radius: 6px;
    -khtml-border-radius: 6px;
    border-radius: 6px;
}
</style>
<!--[if lt IE 9]>
    <script src="${base!}/assets/js/html5shiv.js"></script>
    <script src="${base!}/assets/js/respond.min.js"></script>
    <script src="${base!}/assets/js/json2.js"></script>
    <![endif]-->
<script src="${base!}/assets/plugins/modernizr.js"></script>
<script src="${base!}/assets/plugins/jquery-1.11.1.min.js"></script>
<script src="${base!}/assets/js/jquery.pjax.js"></script>
<body class="hold-transition login-page">
	<div class="login-box">
		<div class="login-logo">
			<img src="${base!}/assets/img/logo.png"> 
			<a href="javascript:void(0);" style="color:#fff">${AppName!}后台管理</a>
		</div>
		<div class="login-box-body">
			<form id="loginForm" action="${base!}/platform/login/doLogin" data-parsley-validate="" novalidate="" role="form" method="post">
				<input type="hidden" id="captcha" name="captcha">
				<div class="form-group has-feedback">
					<input type="text" id="username" name="username" required="required" class="form-control" placeholder="${msg['login.username']}">
					<span class="glyphicon glyphicon-user form-control-feedback"></span>
				</div>
				<div class="form-group has-feedback">
					<input type="password" id="password" name="password" required="required" class="form-control" placeholder="${msg['login.username']}">
					<span class="glyphicon glyphicon-lock form-control-feedback"></span>
				</div>
				<!-- <div class="form-group has-feedback">
					<div class="row">
						<div class="col-xs-7">
							<input type="text" class="form-control" placeholder="验证码">
						</div>
						<div class="col-xs-5 text-right">
							<img src="assets/desktop/img/yzm.jpg">
						</div>
					</div>
				</div> -->
				<p id="tip" class="bg-danger p15" style="display: none"></p>
				<div class="row">
					<div class="col-xs-12" style="margin-top: 10px">
						<button type="submit" class="btn btn-primary btn-block btn-lg">${msg['login.submit']}</button>
					</div>
				</div>
			</form>
		</div>
		<div class="row">
			<div class="col-xs-12 text-center"
				style="margin-top: 20px; color: rgba(255, 255, 255, 0.5)">
				版权所有 优道学车</div>
		</div>
	</div>
	<!-- 验证码 -->
	<div id="dialogVeryCode" class="modal fade bs-modal-sm" tabindex="-3"
		role="dialog" aria-hidden="false">
		<div class="modal-dialog">
			<div class="modal-content">
				<div class="modal-header">
					<h4 class="modal-title" style="color: black;">
						${msg['login.error.verifycode']}</h4>
				</div>
				<div class="modal-body">
					<form id="f2" onsubmit="return false;" data-parsley-validate=""
						novalidate="">
						<div class="row">
							<div class="col-xs-2"></div>
							<div class="col-xs-6">
								<input type="text" id="verifycode" required
									class="form-control input-lg"
									placeholder="${msg['login.captcha']}">
							</div>
							<div class="col-xs-4">
								<img id="captcha_img" src="${base!}/platform/login/captcha"
									style="height: 46px; cursor: pointer;"
									onclick="$('#captcha_img').attr('src', '${base!}/platform/login/captcha?_=' + new Date().getTime())" />
							</div>
						</div>
					</form>
				</div>
				<div class="modal-footer">
					<button id="ok" type="button" class="btn btn-primary"
						data-dismiss="modal">${msg['login.submit']}</button>
				</div>
			</div>
		</div>
	</div>

	<script type="text/javascript">
    $(document).ready(function () {
        $("#year").html(new Date().getFullYear());
        $("#loginForm").ajaxForm({
            dataType: 'json',
            beforeSubmit: function (arr, form, options) {
                form.find("button:submit").text("${msg['login.load']}");
                form.find("button:submit").attr("disabled", "disabled");
            },
            success: function (data, statusText, xhr, form) {
                if (data.code == 0) {
                    $("#tip").hide();
                    form.find("button:submit").text("${msg['login.success']}");
                    window.location.href = "${base!}/platform/home";
                } else if (data.code == 2) {
                    $("#verifycode").val("");
                    $("#dialogVeryCode img").attr("src", '${base!}/platform/login/captcha?_=' + new Date().getTime());
                    return $("#dialogVeryCode").modal({show: true, backdrop: 'static', keyboard: false});
                } else {
                    $("#captcha").val("");
                    $('#captcha_img').attr('src', '${base!}/platform/login/captcha?_=' + new Date().getTime());
                    $("#tip").html(data.msg);
                    $("#tip").fadeIn();
                    form.find("button:submit").text("${msg['login.submit']}");
                    form.find("button:submit").removeAttr("disabled")
                }
            }
        });
        $("#ok").on("click", function () {
            if ($("#verifycode").val() == "") {
                $("#f2").submit();
                return false;
            }
            $("#captcha").val($("#verifycode").val());
            $("#loginForm").submit();
        });
        $("#dialogVeryCode").on("keypress", function (event) {
            var key = event.which;
            if (key == 13) {
                $("#ok").trigger("click");
            }
        });
        $("#username").focus();
    });
</script>


	<script src="${base}/bootstrap-v3.3.7/js/bootstrap.min.js"></script>
	<script src="${base!}/assets/plugins/jquery.form.js"></script>
	<script src="${base!}/assets/plugins/parsley.min.js"></script>
	<script src="${base!}/assets/plugins/parsley.zh_cn.js"></script>

</body>
</html>